package WF.ProductHandel;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.dbutils.ResultSetHandler;

import bean.product;
import bean.pronum;


public class peoductHandel implements ResultSetHandler<List<product>> {

	@Override
	public List<product> handle(ResultSet resultSet) throws SQLException {	      	    
	          List <product> niu=new ArrayList<>();
				while (resultSet.next()){
	                  product info=new product();
	                  info.setProid(resultSet.getInt("proId"));
	                  info.setCateid(resultSet.getInt("cateId"));
	                  info.setC(resultSet.getString("c"));
	                  info.setProname(resultSet.getString("proName"));
	                  info.setPrice1(resultSet.getDouble("price1"));
	                  info.setPrice2(resultSet.getDouble("price2"));
	                  info.setB(resultSet.getString("b"));	                  
	                  info.setState(resultSet.getInt("state"));
	                  info.setCreatetime(resultSet.getString("createTime"));

	                pronum info1=new pronum();
	                info1.setProid(resultSet.getInt("proId"));
	                
	                info1.setNum(resultSet.getInt("num"));
	               
	               info1.setCde(resultSet.getString("cde"));
	                 
	                  info.setPinfo(info1);

	                  niu.add(info);

	              }
	              return niu;

	      
	}
}
	  
		
		